﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace SoucreGame.GLO
{
    public class CglobalFuntion
    {
        public enum LoaiQuan
        {
            QuanTa = 0,
            QuanDich = 1,
            KhongCoQUan = 2
        }
        public enum LoaiO
        {
            Othuong = 0,
            OCam = 1
        }
        public enum KyHieuNhanVat
        {
            //Quan Ta
            NhaLinh = 0,
            ThapCung = 1,
            ThapDoc = 2,
            ThapPhao = 3,
            ThapPhep = 4,
            ThapPhongKhong = 5,
            ThapPhongThu = 6,
            PhapSu = 16,
            PhuSu = 33,
            DauSi = 17,

            //Ky Nang
            KyNangBomNo = 7,
            KyNangHoiMau = 8,
            KyNangLamCham = 9,
            KyNangNoKiem = 10,
            KyNangSamSet = 11,
            KyNangSuTuHong = 12,
            KyNangThienThach = 13,
            KyNangTroi = 14,
            KyNangXoayNuoc = 15,

            //Quan Dich
            Boxu = 18,
            Cade = 19,
            Dode = 20,
            Dodo = 21,
            Doxa = 22,
            Drock = 23,
            Gago = 24,
            Hudu = 25,
            Malu = 26,
            Momo = 27,
            Nuta = 28,
            Raxe = 29,
            Suty = 30,
            Xaxi = 31,
            XuTy = 32
        }
        /// <summary>
        /// ham xac dinh dong, cot
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <returns></returns>
        public static Rectangle ToaDo(int x, int y)
        {
            for (int i = 0; i < 7; i++)
                for (int j = 0; j < 24; j++)
                {
                    Rectangle rec = new Rectangle(CGlobalvariable.cot[j], CGlobalvariable.dong[i], CGlobalvariable.kichThuocO, CGlobalvariable.kichThuocO);
                    if (rec.Contains(x, y))
                        return new Rectangle(i, j, CGlobalvariable.cot[j], CGlobalvariable.dong[i]);
                }
            Rectangle temp = new Rectangle(-1, -1, -1, -1);
            return temp;
        }
    }
}
